package com.gome.bg.service.impl;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gome.bg.entity.User;
import com.gome.bg.entityDao.EntityDao;
import com.gome.bg.service.LoginService;
import com.gome.bg.util.MD5Util;
import com.gome.util.TraceInfo;


public class LoginServiceImpl implements LoginService {

	@Autowired
	private EntityDao entityDao;
	public boolean pswAuthentification(Object obj1, Object obj2) {
		
//		User use  = new User("456","123");
//		entityDao.save(use);
//		TraceInfo.traceInfo();
		boolean flag = false;
		String mackey = "12346";
		String sign = MD5Util.signBySec((String)obj2, mackey);
		User user  = (User) entityDao.pswAuthentification(obj1, sign);
		if(user!=null){
			flag = true;
		}
		return flag;
	}
	public EntityDao getEntityDao() {
		return entityDao;
	}
	
	public void setEntityDao(EntityDao entityDao) {
		this.entityDao = entityDao;
	}

}
